package flown.window.graphics.widget;


import flown.window.graphics.Renderer2D;

/**
 * @author flown
 */

public class Button extends Widget
{
    private String text = "";

    public Button(String text) { this(text, 0, 0, 0, 0); }
    public Button(String text, int x, int y)
    {

        this(text, x, y, 0, 0);
    }
    public Button(String text, int x, int y, int width, int height)
    {
        super(x, y, width, height);
        this.text = text;
    }


    @Override public final void Render(Renderer2D renderer)
    {
        renderer.DrawRect(this.rect.x, this.rect.y, this.rect.width, this.rect.height);
        renderer.DrawText(this.text, this.rect.x, this.rect.y + this.rect.height);
    }
}


